package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.pojo.SkuImage;
import com.atguigu.gmall.product.pojo.SkuInfo;
import com.atguigu.gmall.product.pojo.SpuSaleAttr;
import com.atguigu.gmall.product.vo.CategoryTreeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;

@FeignClient("service-product")
@RequestMapping("/api/inner/rpc/product")
public interface ProductSkuDetailFeignClient {

    @GetMapping("/category/view/{c3id}")
    public Result<CategoryTreeVo> getCateGoryTreeWithC3id(@PathVariable Long c3id);

    @GetMapping("/skuInfo/{skuId}")
    public Result<SkuInfo> getSkuInfo(@PathVariable Long skuId);

    /**
     * 获取Sku照片
     * @param skuId
     * @return
     */
    @GetMapping("/skuImages/{skuId}")
    public Result<List<SkuImage>> getSkuImages(@PathVariable Long skuId);

    /**
     * 获取Sku的实时价格。
     * @param skuId
     * @return
     */
    @GetMapping("/skuPrice/{skuId}")
    public Result<BigDecimal> getPrice(@PathVariable Long skuId);

    @GetMapping("/spuSaleAttr/{spuId}/{skuId}")
    public  Result<List<SpuSaleAttr>> getSpuSaleAttr(@PathVariable Long spuId,@PathVariable Long skuId);

    /**
     * 获取ValueJsong
     * @param skuId
     * @return
     */
    @GetMapping("/valuesSkuJson/{spuId}")
    public Result<String>   getValuesSkuJson(@PathVariable Long  spuId);
}
